﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="./jquery.js"></script>
    
    <script type="text/javascript">
        function moveToFirst(obj) {
            jQuery("#imgContainer").prepend(jQuery(obj).parent());
            var imgs = jQuery("#imgContainer>span");
            
            //for (var i = 0; i < imgs.length; i++) {
            //    jQuery("#sorted").append($(imgs[i]).children().attr("src")+"<br>");
            //}
        }
        
    </script>
</head>
<body>
    <div id="imgContainer">
        <span>
            <img src="./imgs/1.jpeg" onclick="moveToFirst(this);" style="width: 100px; height: 60px" />
        </span>
        <span>
            <img src="./imgs/2.jpeg" onclick="moveToFirst(this);" style="width: 100px; height: 60px" />
        </span> 
        <span>
                <img src="./imgs/3.jpeg" onclick="moveToFirst(this);" style="width: 100px; height: 60px" />
        </span>
    </div>
   
</body>
</html>
